home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH9 / 9-1-3.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-18  |  3.4 KB  |  114 lines

  1. VERSION 5.00
  2. Begin VB.Form frm9_1_3 
  3.    Caption         =   "Colleges"
  4.    ClientHeight    =   2145
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   6240
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   2145
  20.    ScaleWidth      =   6240
  21.    Begin VB.PictureBox picResult 
  22.       Height          =   495
  23.       Left            =   120
  24.       ScaleHeight     =   435
  25.       ScaleWidth      =   5955
  26.       TabIndex        =   7
  27.       Top             =   1560
  28.       Width           =   6015
  29.    End
  30.    Begin VB.CommandButton cmdProcess 
  31.       Caption         =   "Process College"
  32.       Height          =   375
  33.       Left            =   2400
  34.       TabIndex        =   6
  35.       Top             =   960
  36.       Width           =   1815
  37.    End
  38.    Begin VB.TextBox txtYear 
  39.       Height          =   285
  40.       Left            =   4560
  41.       TabIndex        =   5
  42.       Top             =   480
  43.       Width           =   615
  44.    End
  45.    Begin VB.TextBox txtState 
  46.       Height          =   285
  47.       Left            =   1680
  48.       TabIndex        =   3
  49.       Top             =   480
  50.       Width           =   615
  51.    End
  52.    Begin VB.TextBox txtCollege 
  53.       Height          =   285
  54.       Left            =   1680
  55.       TabIndex        =   1
  56.       Top             =   120
  57.       Width           =   3495
  58.    End
  59.    Begin VB.Label lblYear 
  60.       Alignment       =   1  'Right Justify
  61.       Caption         =   "Year founded:"
  62.       Height          =   255
  63.       Left            =   3120
  64.       TabIndex        =   4
  65.       Top             =   480
  66.       Width           =   1215
  67.    End
  68.    Begin VB.Label Label2 
  69.       Alignment       =   1  'Right Justify
  70.       Caption         =   "State (abbrev.):"
  71.       Height          =   255
  72.       Left            =   120
  73.       TabIndex        =   2
  74.       Top             =   480
  75.       Width           =   1455
  76.    End
  77.    Begin VB.Label lblName 
  78.       Alignment       =   1  'Right Justify
  79.       Caption         =   "Name of College:"
  80.       Height          =   255
  81.       Left            =   0
  82.       TabIndex        =   0
  83.       Top             =   120
  84.       Width           =   1575
  85.    End
  86. Attribute VB_Name = "frm9_1_3"
  87. Attribute VB_GlobalNameSpace = False
  88. Attribute VB_Creatable = False
  89. Attribute VB_PredeclaredId = True
  90. Attribute VB_Exposed = False
  91. Private Sub cmdProcess_Click()
  92.   Dim century As Integer, when As String
  93.   'Demonstrate use of records
  94.   picResult.Cls
  95.   Dim college As collegeData
  96.   college.nom = txtCollege.Text
  97.   college.state = txtState.Text
  98.   college.yearFounded = Val(txtYear.Text)
  99.   century = 1 + Int(college.yearFounded / 100)
  100.   picResult.Print RTrim(college.nom); " was founded in the" & Str(century);
  101.   picResult.Print "th century in "; college.state
  102.   Dim university As collegeData
  103.   university.nom = "M.I.T."
  104.   university.state = "MA"
  105.   university.yearFounded = 1878
  106.   If college.yearFounded < university.yearFounded Then
  107.       when = "before "
  108.     Else
  109.       when = "after "
  110.   End If
  111.   picResult.Print RTrim(college.nom); " was founded ";
  112.   picResult.Print when; RTrim(university.nom)
  113. End Sub
  114.